from socket import *

udpSocket = socket(AF_INET,SOCK_DGRAM);

udpSocket.bind(('',8080))

num = 0
while True:
  recvInfo = udpSocket.recvfrom(1024)
  content, receiveAddr = recvInfo
  num += 1
  print("%d ---> [%s]:%s"%(num, str(receiveAddr), content.decode('gbk')))
  udpSocket.sendto(content, receiveAddr)

udpSocket.close()